
import * as helper from '../../utils/helper'

export const getModlues = (cb) =>{

  wx.request({
    url: 'https://market.douban.com/api/v2/market/home/modules?ivk_sa=1024320u', 
    data: {},
    header: {
      'content-type': 'application/json' // 默认值
    },
    success (res) {
      console.log(res)
      if(res.statusCode === 200){
        if(res.data){
          typeof cb === 'function' && cb(res.data)
        }else{
          helper.showToast(res.errMsg)
        }
      }else{
        helper.showToast(res.errMsg)
      }
    }
  })
}

